import React from 'react'
import { render } from 'react-dom'
import { createStore, applyMiddleware } from 'redux'
import thunkMiddleware from 'redux-thunk'
import { createLogger } from 'redux-logger'

import Root from './components/Root'
import reducer from './reducers'
import './index.css'
const loggerMiddleware = createLogger()
const store = createStore(reducer,
  applyMiddleware(
    thunkMiddleware, // lets us dispatch() functions
    loggerMiddleware // neat middleware that logs actions
  ))

render(
    <Root store={store}/>,
  document.getElementById('root')
)
